<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>供应商收入审核详情-思途CMS{$coreVersion}</title>
    {php echo Common::getCss('style.css,base.css,base_new.css'); }
    {Common::css_plugin('lightbox.min.css', 'sterp')}
    {template 'stourtravel/public/public_js'}
    {Common::js_plugin('lightbox.min.js', 'sterp')}
    <style>
        table{
            margin-left: 10px;
        }
    </style>
</head>
<body>

<table class="content-tab" body_html=5AG0mD >
    <tr>
        <td width="119px" class="content-lt-td" valign="top">
            {template 'stourtravel/public/leftnav'}
            <!--右侧内容区-->
        </td>
        <td valign="top" class="content-rt-td" style="overflow:hidden">
            <div class="cfg-header-bar">
                <a href="javascript:;" class="fr btn btn-primary radius mt-6 mr-10" onclick="window.location.reload()">刷新</a>
            </div>
            <div class="clear clearfix">
                <ul class="info-item-block">
                    <li>
                        <span class="item-hd">订单号：</span>
                        <div class="item-bd">
                            <a href="javascript:;" onclick="order_view({$info['orderid']},{$info['type_id']})" class="btn-link item-text">{$info['ordersn']}</a>
                        </div>
                    </li>
                    <li>
                        <span class="item-hd">产品类别：</span>
                        <div class="item-bd">
                            <span class="item-text">{$info['pdt_type']}</span>
                        </div>
                    </li>
                    <li>
                        <span class="item-hd">支付方式：</span>
                        <div class="item-bd">
                            <span class="item-text">{if $info['is_online'] == 1 && $info['pay_num']}线上支付{else}线下支付{/if}</span>
                        </div>
                    </li>
                    <li>
                        <span class="item-hd">支付渠道：</span>
                        <div class="item-bd">
                            <span class="item-text">{php echo $info['pay_type'] ? $info['pay_type'] : '--';}</span>
                        </div>
                    </li>
                    <li>
                        <span class="item-hd">支付时间：</span>
                        <div class="item-bd">
                            <span class="item-text">{date('Y-m-d H:i:s', $info['pay_time'])}</span>
                        </div>
                    </li>

                    {if $info['is_online'] == 1}
                    {php}
                        $transaction = json_decode($info['pay_num'],1);
                        $pay_num = $transaction['transaction_no'] ? $transaction['transaction_no'] : '--';
                    {/php}
                    <li>
                        <span class="item-hd">交易流水号：</span>
                        <div class="item-bd">
                            <span class="item-text">{$pay_num}</span>
                        </div>
                    </li>
                    {else}
                    <li>
                        <span class="item-hd">付款凭证：</span>
                        <div class="item-bd">
                            <a href="{$info['pay_proof']}" rel="lightbox">
                                <img id="payProofImg" src="{$info['pay_proof']}" class="up-img-area" />
                            </a>
                        </div>
                    </li>
                    {/if}
                    <li>
                        <span class="item-hd">联系人：</span>
                        <div class="item-bd">
                            <span class="item-text">{$info['linkman']}</span>
                        </div>
                    </li>
                    <li>
                        <span class="item-hd">联系电话：</span>
                        <div class="item-bd">
                            <span class="item-text">{$info['linktel']}</span>
                        </div>
                    </li>

                    <li>
                        <span class="item-hd">明细：</span>
                        <div class="item-bd">
                            <?php
                            switch ($info['type_id']) {
                                case 1:
                                case 114:
                                    $table = '<table class="table table-border table-bordered table-bg table-order w600">
                                        <thead>
                                        <tr class="text-c">
                                            <th><span class="c-999">类别</span></th>
                                            <th><span class="c-999">成本</span></th>
                                            <th><span class="c-999">利润</span></th>
                                            <th><span class="c-999">数量</span></th>
                                            <th><span class="c-999">小计</span></th>
                                        </tr>
                                        </thead>
                                        <tbody>';
                                    if($info['dingnum']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">成人</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['basicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['profit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['dingnum'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['price']*$info['dingnum'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    if($info['oldnum']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">老人</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['oldbasicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['oldprofit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['oldnum'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['oldprice']*$info['oldnum'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    if($info['childnum']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">儿童</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['childbasicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['childprofit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['childnum'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['childprice']*$info['childnum'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    if($info['people4_num']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">'.$people_group[4]['name'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['people4_basicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['people4_profit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['people4_num'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['people4_price']*$info['people4_num'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    if($info['people5_num']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">'.$people_group[5]['name'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['people5_basicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['people5_profit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['people5_num'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['people5_price']*$info['people5_num'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    if($info['people6_num']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">'.$people_group[6]['name'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['people6_basicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['people6_profit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['people6_num'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['people6_price']*$info['people6_num'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    $table.='  </tbody>
                                    </table>';
                                    echo $table;
                                    break;
                                default:
                                    $table = '<table class="table table-border table-bordered table-bg table-order w600">
                                        <thead>
                                        <tr class="text-c">
                                            <th><span class="c-999">类别</span></th>
                                            <th><span class="c-999">成本</span></th>
                                            <th><span class="c-999">利润</span></th>
                                            <th><span class="c-999">数量</span></th>
                                            <th><span class="c-999">小计</span></th>
                                        </tr>
                                        </thead>
                                        <tbody>';
                                    if($info['dingnum']){
                                        $table.='<tr class="text-c">
                                            <td>
                                                <span class="c-999">价格</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['basicprice'].'</span>
                                            </td>
                                            <td>
                                                <span class="c-999">'.$info['profit'].'</span>
                                            </td>
                                             <td>
                                                <span class="c-999">'.$info['dingnum'].'</span>
                                             </td>
                                            <td>
                                                <span class="c-f60">'.$info['price']*$info['dingnum'].'</span>
                                            </td>
                                        </tr>';
                                    }
                                    $table.='  </tbody>
                                    </table>';
                                    echo $table;
                                    break;

                            }
                            ?>
                        </div>
                    </li>

                    {if $info['privileg_price']&&$info['privileg_price']!='0.00'}
                    <li>
                        <span class="item-hd">优惠总额：</span>
                        <div class="item-bd">
                            <strong class="item-text c-f60 f">&yen;{$info['privileg_price']}</strong>
                        </div>
                    </li>
                    {/if}

                    {if $info['express_total_price'] && $info['express_total_price']!='0.00'}
                    <li>
                        <span class="item-hd">运费：</span>
                        <div class="item-bd">
                            <strong class="item-text c-f60 f">&yen;{$info['express_total_price']}</strong>
                        </div>
                    </li>
                    {/if}
                    <li>
                        <span class="item-hd">营业收入：</span>
                        <div class="item-bd">
                            <strong class="item-text c-f60 f">&yen;{$info['amount']}</strong>
                        </div>
                    </li>
                    <li>
                        <span class="item-hd">到账状态：</span>
                        <div class="item-bd">
                            {if $info['status'] == 0}
                            <span class="item-text c-f60">待确认</span>
                            {else}
                            <span class="item-text">已到账</span>
                            {/if}
                        </div>
                    </li>
                    {if $info['status'] == 1 && $info['operator']}
                        <li>
                            <span class="item-hd">操作人员：</span>
                            <div class="item-bd">
                                <span class="item-text">{$info['operator']}</span>
                            </div>
                        </li>
                        <li>
                            <span class="item-hd">操作时间：</span>
                            <div class="item-bd">
                                <span class="item-text">{date('Y-m-d H:i:s',$info['opt_time'])}</span>
                            </div>
                        </li>
                    {/if}
                </ul>
                {if $info['status'] == 0}
                <div class="clear">
                    <a href="javascript:;" id="sure_btn" class="btn btn-primary radius size-L ml-115">确认到账</a>
                </div>
                {/if}
                <select name="typeid" class="select" id="modules" style="display:none">
                    {loop $modules $row}
                    <option value="{$row['id']}" data-py="{$row['maintable']}" data-menuid="{$row['menuid']}">{$row['modulename']}</option>
                    {/loop}
                </select>
            </div>
        </td>
    </tr>
</table>
<script>
    $(function(){

        //图片点击事件
        $("#payProofImg").on("click",function(){

        });

        //确认到账
        $('#sure_btn').click(function () {
            ST.Util.confirmBox('提示','确定该笔费用已到账?',function () {
                $.post(
                    SITEURL + '{$prefix_url}/ajax_update',
                    {id:'{$info["id"]}', filed: 'status', val: 1, ordersn: '{$info["ordersn"]}'},
                    function (data) {
                        if(data.status){
                            window.location.reload();
                        }
                    },
                    'json'
                );
            });
        });
    });

    //订单详情
    function order_view(id,typeid) {

        var py=$('#modules').find('option[value="'+typeid+'"]');
        var pinyin = py.attr('data-py');
        var url = SITEURL + pinyin + "/admin/order/view/id/"+id+"/typeid/"+typeid;
        if(pinyin == 'model_archive'){
            url = SITEURL + '/order/view/id/'+id+'/typeid/'+typeid;
        }
        url+='/menuid/'+py.attr('data-menuid');
        ST.Util.addTab('{$info["pdt_type"]}订单：{$info["ordersn"]}',url,1);
    }
</script>

</body>
</html>